<template>
  <el-row class="navbar">
    <el-col class="logo" :span="4" :offset="2">
      <el-image
          style="height: 60px"
          :src="require('../../assets/holo_logo.png')"
          fit="fit">
      </el-image>
    </el-col>
    <el-col class="navtag" :class="{_active: computed_is_active===1}" :span="2" @click.native="to(1)">首页</el-col>
    <el-col class="navtag" :class="{_active: computed_is_active===2}" :span="2" @click.native="to(2)">信息检索</el-col>
    <el-col class="navtag" :class="{_active: computed_is_active===3}" :span="2" @click.native="to(3)">漏洞分析</el-col>
    <el-col class="navtag" :class="{_active: computed_is_active===4}" :span="2" @click.native="to(4)">细粒度分析</el-col>
  </el-row>
</template>

<script>
export default {
  name: "NavBAr",
  props: {
    is_active: {
      type: Number,
      default: 1,
    }
  },
  data() {
    return {
      active: this.is_active,
    }
  },
  methods: {
    to: function (arg) {
      this.active = arg
      this.$emit("change_tag", { to: this.active, pkg: "" });
    },
  },
  computed: {
    computed_is_active () {
      return this.is_active
    }
  }
}
</script>

<style scoped>
.navbar {
  background: #1d2641;
  height: 60px;
  width: 100%;
  margin: -8px -8px 0 -8px;
  position: fixed;
  z-index: 99;
}

.navtag {
  display: block;
  line-height: 60px;
  text-align: center;
  color: white;
  transition: 0.2s;
}
.navtag:hover {
  color: #0e90ff;
  cursor: pointer;
}

.logo {
 line-height: 60px;
}

._active {
  color: #0e90ff;
}
</style>